<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body align="center">
	<table align="center" border="1" summary="상세 내용">
		<caption>상세 화면</caption>
		<tr height="40" align="left">
			<td bgcolor="f6f6f6" width="80">&nbsp;&nbsp;&nbsp;번호</td>
			<td width="150">&nbsp;&nbsp;&nbsp;${qnaList.board_no }</td>
		</tr>
		<tr height="40" align="left">
			<td bgcolor="f6f6f6" width="80">&nbsp;&nbsp;&nbsp;제목</td>
			<td width="150">&nbsp;&nbsp;&nbsp;${qnaList.board_title  }</td>
		</tr>
		<tr height="40" align="left">
			<td bgcolor="f6f6f6" width="80">&nbsp;&nbsp;&nbsp;글쓴이</td>
			<td width="150">&nbsp;&nbsp;&nbsp;${qnaList.board_writer  }</td>
		</tr>
		<tr height="40" align="left">
			<td bgcolor="f6f6f6" width="80">&nbsp;&nbsp;&nbsp;등록날짜</td>
			<td width="150">&nbsp;&nbsp;&nbsp;${qnaList.board_date  }</td>
		</tr>
		<tr height="40" align="left">
			<td bgcolor="f6f6f6" width="80">&nbsp;&nbsp;&nbsp;조회수</td>
			<td width="150">&nbsp;&nbsp;&nbsp;${qnaList.board_readacount  }</td>
		</tr>
		<tr height="40" align="left">
			<td bgcolor="f6f6f6" width="80">&nbsp;&nbsp;&nbsp;내용</td>
			<td width="150">&nbsp;&nbsp;&nbsp;${qnaList.board_content  }</td>
		</tr>
	</table>
				<a href="Delete?board_no=${qnaList.board_no}"><input type="button" value="삭제"></a>
	<br><br>
	<table width=60% border="1" align=center margin=0 padding=0 cellpadding=0 cellspacing=1 style=" border-width: 1; border-color: rgb(204, 204, 204); border-style: dotted;">
		<c:forEach items="${commentList}" var="comment">
			<tr bgcolor="#f0f0f0">
				<td width="13%" align=center style='word-break: break-all;'rowspan="2">
				<b>${comment.user_id}</b>
				<input type="hidden" name="comment_no" value="${comment.comment_no}"></td>
				<td align="left" width="75%" style="border-right: 0 none;">
					&nbsp;${comment.registdate}</td>
				<td style="border-left: 0 none;">
					<a href="FAQcommentDelete?comment_no=${comment.comment_no }">삭제</a>
			</td>
			</tr>
			<tr align="left" bgcolor="#f0f0f0">
				<td colspan="2" style='word-break: break-all;'>&nbsp;${comment.comment}</td>
			</tr>
			<tr align="left" bgcolor="#f0f0f0">
				<td colspan="3" style='word-break: break-all;'>
					<div id="div_reply1Form${cnt.index }" style="hidden:none"></div>
				</td>
			</tr>
			
			
 			<c:forEach items="${replyList}" var="reply">
 			<c:if test="${comment.comment_no  == reply.getComment_no()}">
					<tr>
						<td width="13%" align=center style='word-break: break-all;'rowspan="2">
						<b>${reply.getWriter()} </b>
						<input type="hidden" name="comment_no" value="${reply.getComment_no()} "></td>
						
						<td align="left" width="75%" style="border-right: 0 none; border-color: white;">
						&nbsp;${reply.getDate()}</td>
						<td style="border=left:0 none; border-color: white;">
							<a href="faqreplyDelete?no=${reply.no }">삭제</a>
						</td>
					</tr>
					<tr align="left" >
						<td colspan="2" style='word-break: break-all;'>&nbsp;${reply.getUser_id()} >>> ${reply.getContent()}</td>
					</tr>
					<tr align="left" bgcolor="#f0f0f0">
						<td colspan="3" style='word-break: break-all;'>
							<div id="div_commentreply2Form${cnt.index }" style="hidden:none"></div>
						</td>
					</tr>
				</c:if>
			</c:forEach> 
		</c:forEach>
	</table>
</body>
</html>